﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using imaginecup.information;

using Microsoft.Xna.Framework;
using imaginecup.objectManager;

namespace imaginecup.util
{
    public abstract class BaseComponent
    {
        protected GObjectID m_ObjectID;
        protected ObjectManager m_ObjectMan;
        protected bool m_bCmpEnable;

        public virtual void Init() { }
        public virtual void Release() { }

        public BaseComponent(GObjectID a_GID , ObjectManager ObjMan)
        {
            m_ObjectID = a_GID;
            m_ObjectMan = ObjMan;
            m_bCmpEnable = true;
        }



        public void SetCmpEnable(bool enableBool)
        {
            m_bCmpEnable = enableBool;
        }
        public bool GetCmpEnable()
        {
            return m_bCmpEnable;
        }

        public ObjectManager GetObjectManger()
        {
            return m_ObjectMan;
        }

        public void SetObjectID(GObjectID a_GID)
        {
            m_ObjectID = a_GID;
        }

        public GObjectID GetObjectID()
        {
            return m_ObjectID;
        }

        public virtual EMessageResult HandleMessage(GMessage a_Msg) { return EMessageResult.MR_IGNORED; }
        public abstract  SComponentTypeID GetComponentTypeID();
        //오브젝트 ID를 이용하여 Entity정보를 받아온다.
        public abstract ICmpEntity GetEntity();
    }
}
